package com.program.facesigninsystem.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

/**
 * Swagger API文档相关配置
 */
@Configuration
@EnableSwagger2
public class SwaggerConfig extends BaseSwaggerConfig {
//    @Value("${swagger2.host:127.0.0.1:8080}")
//    private String swaggerHost;
//    @Bean
//    public Docket createRestApi() {
//
//        return new Docket(DocumentationType.SWAGGER_2)
//                .host(swaggerHost)
//                .select()
//                .apis(RequestHandlerSelectors.basePackage("jtl3d"))
//                .paths(PathSelectors.any())
//                .build();
//    }

    @Override
    public SwaggerProperties swaggerProperties() {
        return SwaggerProperties.builder()
                .apiBasePackage("com.program.facesigninsystem")
                .title("享签")
                .description("前后端联调加油w(ﾟДﾟ)w   created by GA")
                .contactName("GA")
                .version("1.0")
                .enableSecurity(true)
                .build();
    }

}
